import uvicorn
from fastapi import FastAPI
from pydantic import BaseModel



# 数据模型
class SubAgentThinking(BaseModel):
    sub_agent_type: str
    stream: bool
    thinking_step: str


front_service = FastAPI()

@front_service.get("/")
def read_root():
    return "This is a dummy frontend_psot_server for testing subagents individually."

@front_service.post('/agents/insight_thinking_steps')
async def respond_insight_result_post(sub_agent_thinking: SubAgentThinking):
    thinking_step = f'🤝 协作智能体 **{sub_agent_thinking.sub_agent_type}**：{sub_agent_thinking.thinking_step}'
    print(f"[respond_insight_result_post ok] {thinking_step}")
    
    return {
        "code": "200",
        "msg": "操作成功！",
        "insight_result": f"收到思考过程{sub_agent_thinking.thinking_step}"
    }



if __name__ == "__main__":
    uvicorn.run(front_service, host="0.0.0.0", port=3000)